import request from '@/utils/request'

// 查询动作信息列表
export function listAction(query) {
  return request({
    url: '/zndd/action/list',
    method: 'get',
    params: query
  })
}

// 查询动作信息详细
export function getAction(id) {
  return request({
    url: '/zndd/action/' + id,
    method: 'get'
  })
}

// 新增动作信息
export function addAction(data) {
  return request({
    url: '/zndd/action',
    method: 'post',
    data: data
  })
}

// 修改动作信息
export function updateAction(data) {
  return request({
    url: '/zndd/action',
    method: 'put',
    data: data
  })
}

// 删除动作信息
export function delAction(id) {
  return request({
    url: '/zndd/action/' + id,
    method: 'delete'
  })
}

//根据三级产线id查询产品信息
export function getProductByThreeId(threeId) {
  return request({
    url: '/zndd/action/getProductByThreeId?threeId='+threeId,
    method: 'post',
  })
}

//预排
export function addActionPlan(threeId,productId,threeNo) {
  return request({
    url: '/zndd/action/addActionPlan?threeId='+threeId+"&productId="+productId+"&threeNo="+threeNo,
    method: 'post',
  })
}
